package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PostManageReplyMapper;
import com.ruoyi.system.domain.PostManageReply;
import com.ruoyi.system.service.IPostManageReplyService;

/**
 * 回帖Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-24
 */
@Service
public class PostManageReplyServiceImpl implements IPostManageReplyService 
{
    @Autowired
    private PostManageReplyMapper postManageReplyMapper;

    /**
     * 查询回帖
     * 
     * @param id 回帖主键
     * @return 回帖
     */
    @Override
    public PostManageReply selectPostManageReplyById(Long id)
    {
        return postManageReplyMapper.selectPostManageReplyById(id);
    }

    /**
     * 查询回帖列表
     * 
     * @param postManageReply 回帖
     * @return 回帖
     */
    @Override
    public List<PostManageReply> selectPostManageReplyList(PostManageReply postManageReply)
    {
        return postManageReplyMapper.selectPostManageReplyList(postManageReply);
    }

    /**
     * 新增回帖
     * 
     * @param postManageReply 回帖
     * @return 结果
     */
    @Override
    public int insertPostManageReply(PostManageReply postManageReply)
    {
        postManageReply.setCreateTime(DateUtils.getNowDate());
        return postManageReplyMapper.insertPostManageReply(postManageReply);
    }

    /**
     * 修改回帖
     * 
     * @param postManageReply 回帖
     * @return 结果
     */
    @Override
    public int updatePostManageReply(PostManageReply postManageReply)
    {
        postManageReply.setUpdateTime(DateUtils.getNowDate());
        return postManageReplyMapper.updatePostManageReply(postManageReply);
    }

    /**
     * 批量删除回帖
     * 
     * @param ids 需要删除的回帖主键
     * @return 结果
     */
    @Override
    public int deletePostManageReplyByIds(Long[] ids)
    {
        return postManageReplyMapper.deletePostManageReplyByIds(ids);
    }

    /**
     * 删除回帖信息
     * 
     * @param id 回帖主键
     * @return 结果
     */
    @Override
    public int deletePostManageReplyById(Long id)
    {
        return postManageReplyMapper.deletePostManageReplyById(id);
    }
}
